package com.zhuhjay.model.dto;

import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;

/**
 * @author ZhuHJay
 * @date 2023/4/27 10:50
 */
@Data
public class BookInsertDto {

    @NotBlank(message = "书籍名称不能为空")
    private String name;
    @Range(min = 1, message = "书籍类型id不合法")
    private Integer typeid;
    @Min(value = 0, message = "书籍价格不能小于0")
    private Float price;
    @NotBlank(message = "书籍描述不能为空")
    private String desc;
    @NotBlank(message = "书籍出版社不能为空")
    private String publish;
    @NotBlank(message = "书籍作者不能为空")
    private String author;
    @Range(min = 0, message = "书籍库存不能小于0")
    private Integer stock;
    @NotBlank(message = "书架不能为空")
    private String address;

}
